﻿namespace LS.Nc6.Web.Entry.Areas.Cms
{
    public  class CmsHelper
    {
        /// <summary>
        /// 返回默认字段
        /// </summary>
        /// <returns></returns>
        public static List<TablestyleInput> GetDefaultContentTableStyle()
        {
            List<TablestyleInput> list = new List<TablestyleInput>();
            #region 标题
            var style = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "Title",
                DisplayName = "标题",
                Taxis = 1,
                HelpText = string.Empty,
                List = 0,
                InputType = InputType.Text.ToString(),
                DefaultValue = string.Empty,
               //RuleValues = JsonSerializer.Serialize(new List<InputStyleRule>
               // {
               //     new InputStyleRule
               //     {
               //         Type = ValidateType.Required.ToString(),
               //         Message = "标题为必填项"
               //     }
               // }, CommonMethodHelper.MyJsonOptions),
                ExtendRuleValues = new List<InputStyleRule>
                {
                    new InputStyleRule
                    {
                        Type = ValidateType.Required.ToString(),
                        Message = "标题为必填项"
                    }
                }
            };
            list.Add(style);
            #endregion

            #region 副标题
            var style_subTitle = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "SubTitle",
                DisplayName = "副标题",
                Taxis = 2,
                HelpText = string.Empty,
                List = 0,
                InputType = InputType.Text.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_subTitle);
            #endregion

            #region 图片
            var style_imageUrl = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "ImageUrlIds",
                DisplayName = "图片",
                Taxis = 3,
                HelpText = string.Empty,
                List = 0,
                InputType = InputType.Image.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_imageUrl);
            #endregion

            #region 视频
            var style_videoUrl = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "VideoUrlIds",
                DisplayName = "视频",
                Taxis = 4,
                HelpText = string.Empty,
                List = 0,
                InputType = InputType.Video.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_videoUrl);
            #endregion


            #region 附件
            var style_fileUrl = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "FileUrlIds",
                DisplayName = "附件",
                Taxis = 5,
                HelpText = string.Empty,
                List = 0,
                InputType = InputType.File.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_fileUrl);
            #endregion

            #region 内容
            var style_body = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "Body",
                DisplayName = "内容",
                Taxis = 6,
                HelpText = String.Empty,
                List = 0,
                InputType = InputType.TextEditor.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_body);
            #endregion


            #region 内容摘要
            var style_summary = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "Summary",
                DisplayName = "内容摘要",
                Taxis = 7,
                HelpText = String.Empty,
                List = 0,
                InputType = InputType.TextArea.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_summary);
            #endregion

            #region 作者
            var style_author = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "Author",
                DisplayName = "作者",
                Taxis = 8,
                HelpText = String.Empty,
                List = 0,
                InputType = InputType.Text.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_author);
            #endregion

            #region 作者
            var style_source = new TablestyleInput
            {
                Id = 0,
                RelatedIdentity = 0,
                AttributeName = "Source",
                DisplayName = "来源",
                Taxis = 9,
                HelpText = String.Empty,
                List = 0,
                InputType = InputType.Text.ToString(),
                DefaultValue = string.Empty
            };
            list.Add(style_source);
            #endregion

            return list;
        }

        public static List<string> GetAttributteList()
        {
            var list = new List<string>() {
            "Title","SubTitle","ImageUrlIds","VideoUrlIds","FileUrlIds","Body","Summary","Author","Source"
            };
            return list;
        }
        public static List<CheckedItemModel> GetCheckedList()
        {
            List<CheckedItemModel> hashtables = new List<CheckedItemModel>();

            hashtables.Add(new CheckedItemModel
            {
                Id = "1",
                Title = "草稿"
            });

            hashtables.Add(new CheckedItemModel
            {
                Id = "2",
                Title = "待审核"
            });
            hashtables.Add(new CheckedItemModel
            {
                Id = "3",
                Title = "已审核"
            });
            hashtables.Add(new CheckedItemModel
            {
                Id = "4",
                Title = "终审退稿"
            });
            return hashtables;
        }
    }
}
